[#ftl]
${pack_own}

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
${pack_entity}
${pack_entityVo}
${import_class!''}

/**
 * ${data_main.moduleKeyName}
 * ${'@author '+author_str!"admin"}
 * @date ${date_str}
 */
@Mapper
public interface ${name_own}{
[#if table_own?? && table_own.sqlInterfaces??]
[#list table_own.sqlInterfaces as tx]
[#if tx.needFlag == '1']
    /** ${tx.sqlTitle +' '+ tx.sqlDesc!''}*/[#-- 紧跟不换行--]
[#if tx.sqlCode == 'pageList'][#-- 查询分页--]
    List<${name_entityVo}> ${tx.sqlId}(Map<String, Object> paramMap);
    
[#elseif tx.sqlCode == 'selectList'][#-- 查询集合数据--]
    List<${name_entity}> ${tx.sqlId}(Map<String, Object> paramMap);
    
[#elseif tx.sqlCode == 'selectOne'][#-- 查询单条数据--]
    ${name_entity} ${tx.sqlId}(Map<String, Object> paramMap);
    
[#elseif tx.sqlCode == 'selectListEx'][#-- 查询集合数据--]
    List<${name_entityVo}> ${tx.sqlId}(Map<String, Object> paramMap);
    
[#elseif tx.sqlCode == 'selectOneEx'][#-- 查询单条数据--]
    ${name_entityVo} ${tx.sqlId}(Map<String, Object> paramMap);
    
[#elseif tx.sqlCode == 'updMap'][#-- 更新--]
    int ${tx.sqlId}(@Param("record") ${name_entity} record,@Param("map") Map<String, Object> paramMap);
    
[#elseif tx.sqlCode == 'countMap' || tx.sqlCode == 'deleteMap' || tx.sqlCode == 'pageCount'][#-- 查询总数,删除数据--]
    int ${tx.sqlId}(Map<String, Object> paramMap);
    
[#elseif tx.sqlCode == 'insert'][#-- 插入单条数据--]
    int ${tx.sqlId}(${name_entity} record);
    
[#elseif tx.sqlCode == 'update' ][#-- 主键更新--]
    [#if table_own.primaryEntity?? && table_own.primaryEntity?size>0]
    int ${tx.sqlId}(${name_entity} record);
    
    [/#if]
[#elseif (tx.sqlType!'')?length>0]
    [#if tx.sqlType =="select"]
    ${(tx.returnType??)?then(tx.returnType,'List<'+name_entityVo+'>')} ${tx.sqlId}(${(tx.parameterType??)?then(tx.parameterType,'Map<String, Object> paramMap')});
    [#elseif tx.sqlType =="update"]
    
    [#elseif tx.sqlType =="insert"]
    
    [#elseif tx.sqlType =="delete"]
    
    [/#if]
    
[/#if]
[/#if]
[/#list]
[#else]
    /** 查询分页*/
    List<${name_entityVo}> selectPageList(Map<String, Object> paramMap);
    
    /** 查询分页总数--*/
    int selectPageCount(Map<String, Object> paramMap);
    
    /** 查询集合数据*/
    List<${name_entity}> selectListByMap(Map<String, Object> paramMap);
    
    /** 查询单条数据*/
    ${name_entity} selectOneByMap(Map<String, Object> paramMap);
    
    /** 查询集合数据*/
    List<${name_entityVo}> selectListByMapEx(Map<String, Object> paramMap);
    
    /** 查询单条数据*/
    ${name_entityVo} selectOneByMapEx(Map<String, Object> paramMap);
    
    /** 查询总数--*/
    int countByMap(Map<String, Object> paramMap);
    
    /** 更新*/
    int updateByMap(@Param("record") Map<String, Object> record,@Param("map") Map<String, Object> paramMap);
    
    /** 删除数据--*/
    int deleteByMap(Map<String, Object> paramMap);
    
    /** 插入单条数据--*/ 
    int insert(${name_entity} record);
    
    [#if table_own.primaryEntity?? && table_own.primaryEntity?size>0]
    /** 主键更新*/
    int update(${name_entity} record);
    
    [/#if]
[/#if]
}